from flask import Flask, jsonify, request, Blueprint
from flask_sqlalchemy import SQLAlchemy
from flask_docs import ApiDoc
#from gevent import pywsgi

app = Flask(__name__)
app.config.from_pyfile('config.py')
db = SQLAlchemy(app)

# Using CDN
app.config['API_DOC_CDN'] = True
# Disable document pages
# app.config['API_DOC_ENABLE'] = False
# 需要显示文档的API
app.config['API_DOC_MEMBER'] = ['api']
# # 需要排除的RESTFUL Api 文档
app.config['RESTFUL_API_DOC_EXCLUDE'] = []
ApiDoc(app)
api = Blueprint('api', __name__)
platform = Blueprint('platform', __name__)

from models import *

@api.route('/hello')
def hello():
    return 'Hello World!'


app.register_blueprint(api, url_prefix='/api')

if __name__ == '__main__':
    #server = pywsgi.WSGIServer(('0.0.0.0', 5000), app)
   # server.serve_forever()
    app.run(
        host='0.0.0.0',  # 192.168.136.197
        port=5000,
       debug=True
    )
